import request from '@/utils/request'

// 获取家庭列表
export const getFamilyList = () => {
  return request({
    url: '/family',
    method: 'get'
  })
}

// 删除家庭
export const deleteFamily = (id) => {
  return request({
    url: `/family/${id}`,
    method: 'delete'
  })
}

// 添加家庭
export const addFamily = (data) => {
  return request({
    url: '/family',
    method: 'post',
    data
  })
}

// 根据family_id查询
export const getFamilyById = (id) => {
  return request({
    url: `/family/${id}`,
    method: 'get'
  })
}

// 根据admin_user_id查询
export const getFamilyByAdminId = (adminId) => {
  return request({
    url: `/family/admin/${adminId}`,
    method: 'get'
  })
}

// 修改家庭
export const updateFamily = (data) => {
  return request({
    url: '/family',
    method: 'put',
    data
  })
} 